<template>
  <div class="JJHeader">
    <i
      :class="{ FoldIcon: true, 'el-icon-s-fold': true, isCollapse: store.state.sidebar.isCollapse }"
      @click="store.commit('exchange')"
    ></i>
    <div class="UtilsArea"></div>
    <div class="OptionArea">
      <el-button type="text">Sign out</el-button>
    </div>
  </div>
</template>

<script>
import { defineComponent } from 'vue'
import store from '../store'

export default defineComponent({
  name: 'JJHeader',
  data() {
    return {
      store
    }
  }
})
</script>

<style lang="scss">
.JJHeader {
  display: flex;
  align-items: center;
  height: 100%;

  .FoldIcon {
    font-size: 1.5rem;
    cursor: pointer;
    transform: rotate(0);
    transition: transform var(--u-dur);

    &.isCollapse {
      transform: rotate(180deg);
    }
  }

  .UtilsArea {
    flex-grow: 1;
  }
}
</style>
